<template>
	<view class="content bg-white">
		<!-- .sync修饰符:当一个子组件改变了一个 prop 的值时，这个变化也会同步到父组件中所绑定。 -->
		<view style="position: relative;">
			<image style="width: 750rpx;" :src="config.url + '/wx/lsq/share.png'" mode="widthFix"></image>
			<view class="text-center" style="position: absolute; top: 810rpx; width: 750rpx;">
				<!-- <yz-qr :qrPath.sync="qrPath" :text="text" :size1="size1" :quality="quality" :colorDark="colorDark"
					:colorLight="colorLight"></yz-qr> -->
				<image :src="qrPath" style="width: 200rpx; height: 200rpx;"></image>
			</view>
			<view class="qrCode text-red text-bold">{{userInfo.yqm}}</view>
		</view>
		<button style="position: fixed; bottom: 10rpx; width: 730rpx; left: 10rpx;" class="bg-orange block" @click="shareClick">分享</button>
	</view>
</template>

<script>
	import login from "../../../api/new/login"
	import loginApi from "@/api/loginApi.js"
	import yzQr from "@/components/yz-qr/yz-qr.vue"
	import config from "../../../config"
	export default {
		components: {
			yzQr
		},
		data() {
			return {
				config: config,
				modal_qr: false,
				userInfo: {},
				qrPath: 'http://pukei.cn/zcb/#/pages/pay/index?merchantId=',
				text: 'http://pukei.cn/zcb/#/pages/pay/index?merchantId=',
				size1: 90,
				quality: 'H',
				colorDark: '#000000',
				colorLight: '#ffffff'
			}
		},
		// onPullDownRefresh() {
		// 	this.init()
		// },
		methods: {
			init() {
				this.userInfo = uni.getStorageSync("userInfo")
				login.getQRcode({
					page: "pages/index/index",
					scene: this.userInfo.yqm
				}).then(res => {
					console.log(res)
					this.qrPath = "data:image/png;base64," + res.imgBase64
				})
			},
			//传入组件的方法
			hideQrcode() {
				this.modal_qr = false;
			},
			shareClick() {
				
			},
		},
		onLoad() {
			this.init()
		}
	}
</script>

<style>
	.content {
		height: 80vh;
	}

	.text {
		background-color: #f3f3f3;
		margin: 24rpx;
		padding: 24rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	.text text {
		font-weight: 700;
		margin-left: 16rpx;
	}

	.qrCode {
		position: absolute;
		top: 680rpx;
		left: 50%;
		transform: translateX(-50%);
	}
</style>